package model

import "gorm.io/gorm"

type Tag struct {
	gorm.Model
	TagId   string `gorm:"column:tag_id;type:CHAR(38)  NOT NULL; comment:tag唯一id"`
	TagName string `gorm:"column:tag_name;type:VARCHAR(38)  NOT NULL; comment:标签名"`
}
type PostTag struct {
	gorm.Model
	PostId  string `gorm:"column:post_id;type:CHAR(38)  NOT NULL; comment:post唯一id"`
	TagId   string `gorm:"column:tag_id;type:CHAR(38)  NOT NULL; comment:tag唯一id"`
	TagName string `gorm:"column:tag_name;type:VARCHAR(38)  NOT NULL;comment:标签名"`
}

type TagInfo struct {
	TagId   string `json:"tag_id"`
	TagName string `json:"tag_name"`
}

func (Tag) TableName() string {
	return "tags"
}
func (PostTag) TableName() string {
	return "post_tags"
}
